﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using LMKJ.Classes;

namespace LMKJ
{
    public partial class searchitems : System.Web.UI.Page
    {
        private static ArrayList itemList = null;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                itemList = DatabaseManager.RetrieveAllItem();

                itemDlist.DataSource = itemList;
                itemDlist.DataBind();
            }
        }

        protected void searchBtn_Click(object sender, EventArgs e)
        {
            itemList = DatabaseManager.RetrieveItemsByName(searchTbx.Text);

            itemDlist.DataSource = itemList;
            itemDlist.DataBind();
        }

        protected void showAllBtn_Click(object sender, EventArgs e)
        {
            itemList = DatabaseManager.RetrieveAllItem();

            itemDlist.DataSource = itemList;
            itemDlist.DataBind();
        }
    }
}